const path = require('path')
function resolve(dir) {
  return path.join(__dirname, dir)
}
module.exports = {
  pages: {
    index: {
      // entry for the page
      entry: 'src/main.ts',
      // the source template
      template: 'public/index.html',
      // output as dist/index.html
      filename: 'index.html',
      chunks: ['chunk-vendors', 'chunk-common', 'index']
    },
  },
  lintOnSave: true,
  chainWebpack: config => {
    config.resolve.alias
      .set('@', resolve('src'))
      .set('assets', resolve('src/assets'))
      .set('vue$', 'vue/dist/vue.js')
  },
  devServer: {
    proxy: {
      "/service": {
        target: 'http://app1.laravel-rental.test',
        pathRewrite: {
          '^/service' : '' // rewrite path
        }
      }
    }
  }
}
